package com.test.jdk8;

import com.model.Student;

import java.util.ArrayList;
import java.util.List;

public class Demo02_stream {
    public static void main(String[] args) {
        List<Student> objects = new ArrayList<>();
        objects.add(new Student(1,"disable"));
        objects.add(new Student(2,"disable"));
        objects.add(new Student(3,"enable"));

        System.out.println(objects.stream().filter(s->s.getSex().equals("enable")).count());
       if(objects.stream().filter(s->s.getSex().equals("enable")).count()>0) {
           System.out.println("false");
       }
    }

}
